package movie.test.as.user.biz;

import java.awt.print.Pageable;
import java.util.List;
import java.util.Map;

import movie.test.as.user.bean.MovieUserInfo;
import movie.test.as.user.dao.UserInfoDao;
import movie.test.common.BaseBiz;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;

@Component
public class UserInfoBiz extends BaseBiz {

	@Autowired
	private UserInfoDao userInfoDao;

	public MovieUserInfo login(JSONObject objs) {
		
		return userInfoDao.login(objs);
	}

	public int addUser(JSONObject objs) {
		return userInfoDao.addUser(objs);
		
	}

	public int updateUser(JSONObject objs) {
	
		return userInfoDao.updateUser(objs);
	}

	public int deleteUser(JSONObject objs) {
		
		return userInfoDao.deleteUser(objs);
	}

	public MovieUserInfo loginUserInfo(JSONObject objs) {
		
		return userInfoDao.loginUserInfo(objs);
	}

	public List<Map<String,Object>> findAllUserList(JSONObject objs) {
		PageHelper.startPage(getPagePara(objs));
		return userInfoDao.findAllUserList(objs);
	}

	public Map<String, Object> getUserById(JSONObject objs) {
		
		return userInfoDao.getUserById(objs);
	}

	public int updatePasswordById(JSONObject objs) {
		
		return userInfoDao.updatePasswordById(objs);
	}

}
